package com.core.common.manger;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author hl
 * @version 1.0.0
 * @ClassName MangerProperties.java
 * @Description 类描述
 * @createTime 2023年05月05日 13:50:00
 */
@Data
@ConfigurationProperties(prefix = "manger")
public class MangerProperties {


    private StorageProperties storage;
    private NotifyProperties notify;
    private ExpressProperties express;


    @Data
    public static class StorageProperties {
        private String active;
        private Local local;
        private Aliyun aliyun;
        private Tencent tencent;
        private Qiniu qiniu;
        private Minio minio;

        @Data
        public static class Local {
            private String address;
            private String storagePath;

        }

        @Data
        public static class Tencent {
            private String address;
            private String secretId;
            private String secretKey;
            private String region;
            private String bucketName;


        }

        @Data
        public static class Aliyun {
            private String address;
            private String endpoint;
            private String accessKeyId;
            private String accessKeySecret;
            private String bucketName;

        }

        @Data
        public static class Qiniu {
            private String address;
            private String endpoint;
            private String accessKey;
            private String secretKey;
            private String bucketName;
        }
        @Data
        public static class Minio {
            private String address;
            private String endpoint;
            private String accessKey;
            private String secretKey;
            private String bucketName;
        }
    }

    @Data
    public static class NotifyProperties {
        private Mail mail;
        private Sms sms;
        @Data
        public static class Mail {
            private boolean enable;
            private String host;
            private String username;
            private String password;
            private String sendfrom;
            private String sendto;
            private Integer port;
        }
        @Data
        public static class Sms {
            private boolean enable;
            private String active;
            private String sign;
            private Tencent tencent;
            private Aliyun aliyun;
            private List<Map<String, String>> template = new ArrayList<>();
            @Data
            public static class Tencent {
                private int appid;
                private String appkey;
            }
            @Data
            public static class Aliyun {
                private String regionId;
                private String accessKeyId;
                private String accessKeySecret;
            }
        }


    }

    @Data
    public class ExpressProperties {
        private boolean enable;
        private String appId;
        private String appKey;
        private List<Map<String, String>> vendors = new ArrayList<>();
    }


}
